<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
	</head>
	
	
	
	<body>
		<div id="app">
			<!-- 需求：用户通过输入 按特殊的建伟出发函数
			 要求：num=num+num2
			 要求2：用户按回车按钮实现触发
			 -->
			<h3>数值: {{num}}</h3>
			<input type="text" v-on:keyup.enter="addNum()" v-model="num2" />
			<button @click="addNum()">计算</button>
			<button @keyup="addNum()">计算</button>
			
			
		</div>
		
		<script src="../js/vue.js"></script>
		<script >
		const APP=new Vue({
			el: "#app",
			data: {
				num: 10,
				num2:0,
			},
			methods: {
				// unNum(){
				// 	this.num--
				// },
				
					addNum :function(){
						this.num+=parseInt(this.num2)
					}
			}
		})
		</script>	
		
	</body>
</html>
